import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import router from './router'
import { createPinia } from 'pinia'
import App from './App.vue'
import './style.css'

const app = createApp(App)
const pinia = createPinia()

// 确保先使用ElementPlus
app.use(ElementPlus)
// 再使用路由
app.use(pinia)
app.use(router)
app.mount('#app')

// 添加路由调试
router.beforeEach((to, from, next) => {
  console.log('路由变化:', from.path, '->', to.path)
  next()
})
